﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using DeepTime.Shared.Entities;
using System.ComponentModel;

namespace DeepTime.BootStrapper.DataModels
{
    public class UploadedImageCollageMetaDataDataModel : INotifyPropertyChanged
    {
        #region INotifyPropertyChanged Implementation

        public event PropertyChangedEventHandler PropertyChanged;

        protected void OnPropertyChanged(string PropertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged.Invoke(this, new PropertyChangedEventArgs(PropertyName));
            }
        }

        #endregion INotifyPropertyChanged Implementation

        #region Class Members

        public string _PartitionKey;
        public string _RowKey;
        public string _BlobUri;
        public double _X;
        public double _Y;

        #endregion Class Members

        #region Constructors

        public UploadedImageCollageMetaDataDataModel()
        {
        }

        public UploadedImageCollageMetaDataDataModel(UploadedImageCollageMetaDataEntity Entity)
        {
            PartitionKey = Entity.PartitionKey;
            RowKey = Entity.RowKey;
            BlobUri = Entity.BlobUri;
            X = Entity.X;
            Y = Entity.Y;
        }

        public UploadedImageCollageMetaDataDataModel(UploadedImageMetaDataDataModel DataModel)
        {
            PartitionKey = DataModel.PartitionKey;
            RowKey = DataModel.RowKey;
            BlobUri = DataModel.BlobUri;
            X = 0;
            Y = 0;
        }

        #endregion Constructors

        #region Properties

        public string PartitionKey
        {
            get
            {
                return _PartitionKey;
            }
            set
            {
                _PartitionKey = value;
                OnPropertyChanged("PartitionKey");
            }
        }

        public string RowKey
        {
            get
            {
                return _RowKey;
            }
            set
            {
                _RowKey = value;
                OnPropertyChanged("RowKey");
            }
        }

        public string BlobUri
        {
            get
            {
                return _BlobUri;
            }
            set
            {
                _BlobUri = value;
                OnPropertyChanged("BlobUri");
            }
        }

        public double X
        {
            get
            {
                return _X;
            }
            set
            {
                _X = value;
                OnPropertyChanged("X");
            }
        }

        public double Y
        {
            get
            {
                return _Y;
            }
            set
            {
                _Y = value;
                OnPropertyChanged("Y");
            }
        }

        #endregion Properties

        #region Methods

        public UploadedImageCollageMetaDataEntity GetEntity()
        {
            return new UploadedImageCollageMetaDataEntity()
            {
                PartitionKey = this.PartitionKey,
                RowKey = this.RowKey,
                BlobUri = this.BlobUri,
                X = this.X,
                Y = this.Y,
            };
        }

        #endregion Methods
    }
}
